Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GAIA: The function upload_table in the TapPlus class must not allow table names that contain a dot #2971

Merged

Conversation

cosmoJFH
Copy link
Contributor

@cosmoJFH cosmoJFH commented Mar 18, 2024

If a table name that contains a dot is used in the function upload_table, the corresponding table in the Gaia ESA Archive cannot be accessed/removed . The following example describes the issue.

 

from astroquery.gaia import Gaia 
from astropy.table import Table 
a=[1,2,3] b=['a','b','c'] 
table = Table([a,b], names=['col1','col2'], meta={'meta':'first table'}) 

# Upload 
Gaia.login() 
Gaia.upload_table(upload_resource=table, table_name='hola.table_test_from_astropy')

The previous commands generated the following table in the archive

image


A posible solution is to check whether the table name passed to the function upload_table, contains a dot.


cc @esdc-esac-esa-int


Jira: GAIAMNGT-1548

Jorge Fernandez Hernandez added 2 commits March 18, 2024 18:01
Copy link

codecov bot commented Mar 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 66.81%. Comparing base (b530378) to head (3404e94).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2971      +/-   ##
==========================================
+ Coverage   66.80%   66.81%   +0.01%     
==========================================
  Files         237      237              
  Lines       18321    18323       +2     
==========================================
+ Hits        12239    12243       +4     
+ Misses       6082     6080       -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@bsipocz bsipocz added the gaia label Mar 18, 2024
@bsipocz bsipocz added this to the v0.4.8 milestone Mar 18, 2024
Copy link
Member

@bsipocz bsipocz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks all good, thank you! I'll move the changelog and the merge.

CHANGES.rst Outdated
@@ -211,6 +211,9 @@ gaia

- Default Gaia catalog updated to DR3. [#2596]

- The function upload_table in the TapPlus class does not allow table names that contain a dot. [#2971]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this needs to go in the section for the new release. I'll fix it prior merging.

@bsipocz bsipocz merged commit 722385a into astropy:main Mar 18, 2024
9 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants